# -*- coding: utf-8 -*-

#This file is part of pyLot library.
#
# pyLot is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# pyLot is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with pyLot.  If not, see <http://www.gnu.org/licenses/>.

__author__ = u'Guillaume Baty'
__copyright__ = u"Copyright 2011-2012 (C) andheo"
__credits__ = [u'Guillaume Baty']
__license__ = "GNU Lesser General Public License"

__all__ = ['MainWinCommon']

from Qt4 import QtGui
from _pylot.qtgui.default.impl_widget import Widget

class MainWinCommon(Widget):
  def __init__ (self, parent=None):
    Widget.__init__(self)

  def actionQuit(self):
    self.close()

  def _createActions(self):
    self.action_documentation = QtGui.QAction(self)
    self.action_documentation.setObjectName("action_documentation")
    self.action_save = QtGui.QAction(self)
    self.action_save.setObjectName("action_save")
    self.action_load = QtGui.QAction(self)
    self.action_load.setObjectName("action_load")
    self.action_save_as = QtGui.QAction(self)
    self.action_save_as.setObjectName("action_save_as")
    self.action_load_from = QtGui.QAction(self)
    self.action_load_from.setObjectName("action_load_from")
    self.action_quit = QtGui.QAction(self)
    self.action_quit.setObjectName("action_quit")
    self.action_start_recorder = QtGui.QAction(self)
    self.action_start_recorder.setObjectName("action_start_recorder")
    self.action_stop_recorder = QtGui.QAction(self)
    self.action_stop_recorder.setObjectName("action_stop_recorder")

    self.action_infos_plugins = QtGui.QAction(self)
    self.action_infos_plugins.setObjectName("action_infos_plugins")

    self.action_preferences = QtGui.QAction(self)
    self.action_preferences.setObjectName("action_preferences")

  def _createConnexions(self):
    self.action_preferences.triggered.connect(self.actionDisplayPreferences)

  def _translate(self):

    self._setTexts([
      (self.action_preferences, u'Preferences'),
    ])

    self.menu_edit.setTitle(QtGui.QApplication.translate("WinToolBox", "Édition", None, QtGui.QApplication.UnicodeUTF8))
    self.menu_help.setTitle(QtGui.QApplication.translate("WinToolBox", "Aide", None, QtGui.QApplication.UnicodeUTF8))
    self.menu_file.setTitle(QtGui.QApplication.translate("WinToolBox", "Fichier", None, QtGui.QApplication.UnicodeUTF8))
    self.menu_go_app.setTitle(QtGui.QApplication.translate("WinToolBox", "Aller à l\'application", None, QtGui.QApplication.UnicodeUTF8))
    self.menu_scripts.setTitle(QtGui.QApplication.translate("WinToolBox", "Session && scripts", None, QtGui.QApplication.UnicodeUTF8))

    self.action_documentation.setText(QtGui.QApplication.translate("WinToolBox", "Documentation", None, QtGui.QApplication.UnicodeUTF8))
    self.action_save.setText(QtGui.QApplication.translate("WinToolBox", "Sauvegarder", None, QtGui.QApplication.UnicodeUTF8))
    self.action_save.setToolTip(QtGui.QApplication.translate("WinToolBox", "Sauvegarde les valeurs du plugin courant", None, QtGui.QApplication.UnicodeUTF8))
    self.action_load.setText(QtGui.QApplication.translate("WinToolBox", "Charger", None, QtGui.QApplication.UnicodeUTF8))
    self.action_load.setToolTip(QtGui.QApplication.translate("WinToolBox", "Charge les valeurs du plugin courant", None, QtGui.QApplication.UnicodeUTF8))
    self.action_save_as.setText(QtGui.QApplication.translate("WinToolBox", "Sauvegarder dans un fichier", None, QtGui.QApplication.UnicodeUTF8))
    self.action_save_as.setToolTip(QtGui.QApplication.translate("WinToolBox", "Sauvegarde les options du module courant dans un fichier", None, QtGui.QApplication.UnicodeUTF8))
    self.action_load_from.setText(QtGui.QApplication.translate("WinToolBox", "Charger à partir d\'un fichier", None, QtGui.QApplication.UnicodeUTF8))
    self.action_quit.setText(QtGui.QApplication.translate("WinToolBox", "Quitter", None, QtGui.QApplication.UnicodeUTF8))
    self.action_quit.setToolTip(QtGui.QApplication.translate("WinToolBox", "Quitter", None, QtGui.QApplication.UnicodeUTF8))
    self.action_quit.setShortcut(QtGui.QApplication.translate("WinToolBox", "Ctrl+Q", None, QtGui.QApplication.UnicodeUTF8))
    self.action_start_recorder.setText(QtGui.QApplication.translate("WinToolBox", "Démarrer l\'enregistrement", None, QtGui.QApplication.UnicodeUTF8))
    self.action_stop_recorder.setText(QtGui.QApplication.translate("WinToolBox", "Stopper l\'enregistrement", None, QtGui.QApplication.UnicodeUTF8))
    self.action_stop_recorder.setToolTip(QtGui.QApplication.translate("WinToolBox", "Stopper l\'enregistrement", None, QtGui.QApplication.UnicodeUTF8))
    self.action_infos_plugins.setText(QtGui.QApplication.translate("WinToolBox", "Informations sur les plugins", None, QtGui.QApplication.UnicodeUTF8))

  def actionDisplayPreferences(self):
    pass

